package com.myWeb.controller;

import com.myWeb.dao.QuestionDao;
import com.myWeb.entity.Question;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public class QuestionRandServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        QuestionDao dao = new QuestionDao();
        List<Question> questionList = dao.findRand(request);
        javax.servlet.http.HttpSession session = request.getSession(false);
        session.setAttribute("key",questionList);
        request.getRequestDispatcher("/exam.jsp").forward(request,response);

    }
}
